package com.pn.controller;


import com.pn.entity.OutStore;
import com.pn.entity.ReturnGoods;
import com.pn.service.ReturnService;
import com.pn.utils.PageBean;
import com.pn.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("return")
//商品退货
public class ReturnController {

    @Autowired
    private ReturnService returnService;

    //退货列表/return-page-list
    @GetMapping("/return-page-list")
    public Result returnPageList(ReturnGoods returnGoods){
        PageBean<ReturnGoods> pageBean =  returnService.returnPageList(returnGoods);
        return Result.ok(pageBean);
    }

    //确认退货return-confirm
    @PutMapping("/return-confirm")
    public Result returnConfirm(@RequestBody ReturnGoods returnGoods){
        return returnService.returnConfirm(returnGoods);
    }


    //添加退货return-add
    @PostMapping("return-add")
    public Result returnAdd(@RequestBody ReturnGoods returnGoods){
        return returnService.saveReturn(returnGoods);
    }


}
